<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="https://www.thymeleaf.org">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<meta name="description" content="">
		<meta name="author" content="">
		<title>登录页</title>
		<!-- Bootstrap core CSS -->
		<link th:href="@{/static/css/bootstrap.min.css}" rel="stylesheet">
		<!-- Custom styles for this template -->
		<link th:href="@{/static/css/signin.css}" rel="stylesheet">
		<script type="text/javascript" src="/static/js/jquery-3.6.0.js"></script>
		<script>
			$(function (){
				$("#tologin").click(function (){
					$.ajax({
						url: "/wang",
						data: ({"username":$('#username').val(),"password":$('#password').val()}),
						type: "post",
						success: function (data){
							console.log(data['msg'])
							if (data['msg']=="true"){
								window.location.href="/user/main";
							}else {
								$('#mm').html("账号密码错误");
							}
						}
					});
				})
			})
		</script>





	</head>

	<body class="text-center">
		<form class="form-signin" th:action="@{/toLogin}" method="post">
			<img class="mb-4" src="/static/img/bootstrap-solid.svg" alt="" width="72" height="72">
			<h1 class="h3 mb-3 font-weight-normal">请登录</h1>
			<input type="text" name="username" class="form-control" placeholder="账户" required="" autofocus="">
			<input type="password" name="password" class="form-control" placeholder="密码" required="">
			<div class="checkbox mb-3">
			</div>
			<button class="btn btn-lg btn-primary btn-block" type="submit">登录</button>
			<p class="mt-5 mb-3 text-muted">© 2021</p>
			<a class="btn btn-sm">中文</a>
		</form>

<!--		<div class="form-signin">-->
<!--			<img class="mb-4" src="static/img/bootstrap-solid.svg" alt="" width="72" height="72">-->
<!--			<h1 class="h3 mb-3 font-weight-normal">请登录</h1>-->
<!--			<input type="text" id="username" class="form-control" placeholder="账户">-->
<!--			<input type="password" id="password" class="form-control" placeholder="密码" >-->
<!--			<div class="checkbox mb-3">-->
<!--			</div>-->
<!--			<p id="mm"></p>-->
<!--			<button class="btn btn-lg btn-primary btn-block" type="submit" id="tologin">登录</button>-->
<!--			<p class="mt-5 mb-3 text-muted">© 2021</p>-->
<!--			<a class="btn btn-sm">中文</a>-->
<!--		</div>-->

	</body>

</html>